<%--
  Created by IntelliJ IDEA.
  User: Xiaoqz
  Date: 2021/8/31
  Time: 12:03
  To change this template use File | Settings | File Templates.
--%>
<%--isELIgnored: ignored EL(Expression Language)--%>
<%--@ page contentType="text/html;charset=UTF-8" language="java" --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--引入JSTL标签库--%>
<html>
<head>
    <title>update</title>
</head>
<body>
<h3>修改品牌</h3>
<form method="post" action="/jsp-brandCRUD/updateServlet" id="update">
    <%--隐藏域，提交id--%>
    <input type="hidden" name="id" value="${brand.id}">
    品牌名称：<input name="brandName" value=${brand.brandName}><br>
    企业名称：<input name="companyName" value=${brand.companyName}><br>
    排序：<input name="ordered" value=${brand.ordered}><br>
    描述信息：<textarea rows="5" cols="20" name="description">${brand.description}</textarea><br>
    状态：
    <c:if test="${brand.status == 1}">
        <input type="radio" name="status" value="1" checked>启用
        <input type="radio" name="status" value="0">禁用
    </c:if>
    <c:if test="${brand.status != 1}">
        <input type="radio" name="status" value="1">启用
        <input type="radio" name="status" value="0" checked>禁用
    </c:if>
    <br>
    <input type="submit" value="确认修改"> <input type="reset" value="重置信息">
</form>
<script>
    document.getElementById("update").onsubmit = function () {
        let flag = false;
        if (confirm("是否确认修改？")) {
            alert("修改成功！")
            flag = true;
        }
        return flag;
    };
</script>
</body>
</html>
